<img src='partials/TestDataXY_Polynomals.PNG' style='width:400px;float:right'>
<div>
<pre>
<span class='code_snippet' style='font-size: 11px'>

ArrayList&lt;XYDataSeries&gt; xySeriesList = new ArrayList&lt;XYDataSeries&gt;();

ArrayList&lt;DataPoint&gt; values = new ArrayList&lt;DataPoint&gt;();

for (int x = -300; x &lt;= 300; x++) {
double xd = ((double)(x))/100;

DataPoint dp = new DataPoint(xd, f(xd));

values.add(dp);
}

ArrayList&lt;DataPoint&gt; values3 = new ArrayList&lt;DataPoint&gt;();

for (int x = -300; x &lt;= 300; x++) {
double xd = ((double)(x))/100;

DataPoint dp = new DataPoint(xd, gCos(xd));

values3.add(dp);
}

XYDataSeries series = new XYDataSeries(new UIPointCircle(Color.BLUE, 1), new Line(Color.BLUE), "x^2");
series.dataPoints = values;

XYDataSeries series3 = new XYDataSeries(new UIPointCircle(Color.RED, 1), new Line(Color.RED), "e^x");
series3.dataPoints = values3;

xySeriesList.add(series);
xySeriesList.add(series3);

XYChart chart = new XYChart("Polynomals", "x", "y", xySeriesList);

</span></pre></div>